package com.sourceQ.common.core.constant.message;

import cn.hutool.core.util.ObjUtil;
import com.sourceQ.common.core.utils.dataStructure.StringArrayValuable;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

/**
 * @author: SourceQ
 * @create: 2024-04-24 17:05
 * @Description:
 */
@AllArgsConstructor
@Getter
public enum CommonStatusEnum implements StringArrayValuable {

    ENABLE("0", "开启"),
    DISABLE("1", "关闭");
    public static final String[] ARRAYS = Arrays.stream(values()).map(CommonStatusEnum::getStatus).toArray(String[]::new);

    /**
     * 状态值
     */
    private final String status;
    /**
     * 状态名
     */
    private final String name;
    @Override
    public String[] array() {
        return ARRAYS;
    }
    public static boolean isEnable(String status) {
        return ObjUtil.equal(ENABLE.status, status);
    }

    public static boolean isDisable(String status) {
        return ObjUtil.equal(DISABLE.status, status);
    }
}
